﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AntiObesity.DatabaseAccess
{
    /// <summary>
    /// Useage: 
    /// Write: DB.Instance.Current = new ConcreteDatabase();
    /// Read: DB.Instance.Current.GetConnection() 
    /// </summary>
    public sealed class DB
    {
        static readonly DB instance = new DB();
        // Explicit static constructor to tell C# compiler
        // not to mark type as beforefieldinit
        static DB() { }
        DB() { }

        public static DB Instance
        {
            get { return instance; }
        }

        public IDB Current { get; set; }
    }
}
